﻿using NoteBook_Shared.Contact;
using NoteBook_Shared.Parameters;

namespace NoteBook_Product.Services
{
    /// <summary>
    /// 基类仓储服务
    /// </summary>
    public interface IBaseService<TEntity> where TEntity : class
    {
        Task<ApiResponse<TEntity>> AddAsync(TEntity entity);

        Task<ApiResponse<TEntity>> UpdateAsync(TEntity entity);

        Task<ApiResponse> DeleteAsync(int id);

        Task<ApiResponse<TEntity>> GetFirstOfDefaultAsync(int id);

        Task<ApiResponse<PagedList<TEntity>>> GetAllAsync(QueryParameter queryParameter);
    }
}
